package com.qinker.oa.dao;

import com.qinker.oa.model.WorkInfo;
import com.qinker.oa.params.UserResult;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkInfoDao {

    @Select("SELECT aw.u_id as id,nickname from area_workinfo as aw INNER JOIN user_t as ut on aw.u_id = ut.id GROUP BY aw.u_id")
    List<UserResult> getUserListGroupByWork();

    @Select("select * from area_workinfo where u_id = #{uId}")
    List<WorkInfo> getWorkInfoList(int uId);

    @Insert("insert into area_workinfo(content, u_id) values(#{content},#{uId})")
    void addWorkInfo(WorkInfo workInfo);
}
